import {
	defineConfig
} from 'vite'
import uni from '@dcloudio/vite-plugin-uni'

export default defineConfig(() => {
	return {
		server: {
			port: '81',
			host: true,
			open: true,
			proxy: {
				// https://cn.vitejs.dev/config/#server-proxy
				'/dev-api': {
					target: 'http://localhost:8080',
					changeOrigin: true,
					rewrite: (p) => p.replace(/^\/dev-api/, '')
				}
			}
		},
		plugins: [
			uni()
		],
	}
})